<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>视频播放</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body, html, div {
	background-color: black;
	padding: 0;
	margin: 0;
	width: 100%;
	height: 100%;
}
</style>
</head>
<body>
	<div id="a1" style="psotion: relative;"></div>
	<SCRIPT language=javascript src="ckplayer/jquery-1.9.1.min.js"></SCRIPT>
	<script type="text/javascript" src="ckplayer/ckplayer.js"
		charset="gb2312"></script>
	<script type="text/javascript">
		var u = navigator.userAgent;
		var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
		var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
		var Aois = 0;
		if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
			//alert(navigator.userAgent);  
			Aois = 3;
		} else if (/(Android)/i.test(navigator.userAgent)) {
			//alert(navigator.userAgent); 
			Aois = 2;
		} else {
			Aois = 1;
		};

		$.ajax({
					"url" : "getVideoUrl",
					"type" : "get",
					"dataType" : "json",
					"success" : function(obj) {
						if (obj.state == 10) {
							var purl = obj.url;
							var ljfs = 4;
							var flashvars = {
								f : 'ckplayer/m3u8.swf',
								a : encodeURIComponent(purl),
								c : 0, //是否读取文本配置,0不是，1是
								s : ljfs, //调用方式，0=普通方法（f=视频地址），1=网址形式,2=xml形式，3=swf形式
								p : 1, //视频默认0是暂停，1是播放，2是不加载视频
								h : 0, //播放http视频流时采用何种拖动方法，=0不使用任意拖动，=1是使用按关键帧，=2是按时间点，=3是自动判断按什么
								loaded : 'loadedHandler',
								my_url : encodeURIComponent(window.location.href)
							};
							var params = {
								bgcolor : '#FFF',
								allowFullScreen : true,
								allowScriptAccess : 'always'
							};
							var isiPad = navigator.userAgent
									.match(/iPad|iPhone|Linux|Android|iPod/i) != null;
							if (isiPad && Aois > 1
									&& (isAndroid == true || isiOS == true)) {
								document.getElementById('a1').innerHTML = '<video src="'
										+ purl
										+ '" controls="controls" autoplay="autoplay" width="100%" height="100%" style="psotion:relative;""></video>'
							} else {
								var video = [ '->video/mp4' ];
								CKobject.embed('ckplayer/ckplayer.swf', 'a1',
										'ckplayer_a1', '100%', '100%', false,
										flashvars, video, params);
							}

						} else {
							alert(obj.msg);
							window.location.href = "index.html"
						}
					}
				});
	</script>
</body>
</html>
